package com.nice.web;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.eclipse.jetty.websocket.WebSocket;
import org.eclipse.jetty.websocket.WebSocketServlet;

public class Transport extends WebSocketServlet {

	private static final long serialVersionUID = -7289719281366784056L;

	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		ServletContext ctx = getServletContext();
		RequestDispatcher dispatcher = ctx.getNamedDispatcher("default");
		dispatcher.forward(request, response);
	}

	public WebSocket doWebSocketConnect(HttpServletRequest request,
			String protocol) {
		return new WebMsgHandler();
	}
}
